<!DOCTYPE html>
<!-- release v4.5.3, copyright 2014 - 2019 Kartik Visweswaran -->
<!--suppress JSUnresolvedLibraryURL -->
<html lang="en">
<head>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" crossorigin="anonymous">
    <link href="/bootstrap-fileinput-master/css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" crossorigin="anonymous">
    <script src="/lib/jquery/1.9.1/jquery.min.js" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
    <script src="/bootstrap-fileinput-master/js/fileinput.js" type="text/javascript"></script>
    <script src="/bootstrap-fileinput-master/themes/explorer/theme.js" type="text/javascript"></script>
</head>
<body>
<div class="container my-4">
    <form enctype="multipart/form-data">
        <div class="form-group">
            <div class="file-loading">
                <input id="input-b2" name="${fileName}" type="file" class="file" multiple data-show-preview="false">
            </div>
        </div>
    </form>
</div>
</body>
<script>
    var id = ${id}
    $("#input-b2").fileinput({
        language : 'zh',//设置文中文
        uploadUrl : "/upload-json/TH/"+id,//图片上传的url，我这里对应的是后台struts配置好的的action方法
        showCaption : true,//显示标题
        showRemove : true, //显示移除按钮
        uploadAsync : true,//默认异步上传
        textEncoding : "UTF-8",//文本编码
    });
    $("#input-b2").on('fileuploaded', function(event, data, previewId, index) {//异步上传成功结果处理
    });
    $("#input-b2").on('fileerror', function(event, data, msg) {//异步上传失败结果处理
    });

</script>
</html>